package sk.fhi.server.guice;

import net.customware.gwt.dispatch.server.guice.ActionHandlerModule;

import org.apache.commons.logging.Log;

import sk.fhi.server.handler.DeleteHandler;
import sk.fhi.server.handler.GetHandler;
import sk.fhi.server.handler.ListHandler;
import sk.fhi.server.handler.SaveHandler;
import sk.fhi.server.objectify.CRUDServiceImpl;
import sk.fhi.server.service.CRUDService;
import sk.fhi.shared.rpc.action.DeleteAction;
import sk.fhi.shared.rpc.action.GetAction;
import sk.fhi.shared.rpc.action.ListAction;
import sk.fhi.shared.rpc.action.SaveAction;

import com.google.inject.Singleton;

public class GuiceServerModule extends ActionHandlerModule {

	@Override
	protected void configureHandlers() {
		bind(Log.class).toProvider(LogProvider.class).in(Singleton.class);
		bind(CRUDService.class).to(CRUDServiceImpl.class);
		bindHandler(ListAction.class, ListHandler.class);
		bindHandler(DeleteAction.class, DeleteHandler.class);
		bindHandler(SaveAction.class, SaveHandler.class);
		bindHandler(GetAction.class, GetHandler.class);

	}

}
